<?php
use yii\helpers\Html;
use yii\helpers\Url;
/* @var $this \yii\web\View */
/* @var $content string */

//\frontend\assets\MktWapCommonAsset::register($this);
?>
<!--
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta name="keywords" content="首页关键字" />
  <meta name="description" content="首页描述" />
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Cache-Control" content="no-cache" />
  <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=2.0" />
  <meta name="apple-mobile-web-app-capable" content="yes"/>
  
  <link rel="stylesheet" href="../resources/css/weui/weui.min.css">
  <link rel="stylesheet" href="../resources/css/main.min.css">
  <link rel="stylesheet" href="../resources/css/man.min.css">
  
  <script src="../resources/js/jquery-1.10.min.js"></script>
  <script src="../resources/js/jquery.touchSwipe.min.js"></script>
  <script src="../resources/js/frmwebm.min.js"></script>
  <title>新消息提醒</title>
</head>
<body style="background: #ebebeb none repeat scroll 0 0;">

'on_message_post', 'on_message_friend', 'on_message_friend_log', 'on_message_system',
-->
<?php $this->title = '新消息提醒' ?>
<div class="weui_cells weui_cells_form">
    <div class="weui_cell weui_cell_switch">
        <div class="weui_cell_hd weui_cell_primary">帖子消息<span style="color:#999999">提醒</span></div>
        <div class="weui_cell_ft">
            <input  onclick="toggle('on_message_post')" type="checkbox" <?php echo $model->on_message_post ? 'checked="checked"' : ''; ?> class="weui_switch">
        </div>
    </div>
    <div class="weui_cell weui_cell_switch">
        <div class="weui_cell_hd weui_cell_primary">好友消息<span style="color:#999999">提醒</span></div>
        <div class="weui_cell_ft">
            <input  onclick="toggle('on_message_friend')" type="checkbox" <?php echo $model->on_message_friend ? 'checked="checked"' : ''; ?> class="weui_switch">
        </div>
    </div>
    <div class="weui_cell weui_cell_switch">
        <div class="weui_cell_hd weui_cell_primary">好友申请<span style="color:#999999">提醒</span></div>
        <div class="weui_cell_ft">
            <input  onclick="toggle('on_message_friend_log')" type="checkbox" <?php echo $model->on_message_friend_log ? 'checked="checked"' : ''; ?> class="weui_switch">
        </div>
    </div>
    <div class="weui_cell weui_cell_switch">
        <div class="weui_cell_hd weui_cell_primary">系统消息<span style="color:#999999">提醒</span></div>
        <div class="weui_cell_ft">
            <input  onclick="toggle('on_message_system')" type="checkbox" <?php echo $model->on_message_system ? 'checked="checked"' : ''; ?> class="weui_switch">

        </div>
    </div>
</div>

<script type="text/javascript">

function toggle(field) {
	var args = {
		'classname': '\\common\\models\\MktUser',
		'funcname': 'toggleAjax',
		'params': {
			'id' : <?php echo \common\wosotech\Util::getSessionUserId(); ?>,
			'field': field
		}
	};

	$.ajax({
		url: "<?= Url::to(['/wap/ajax-broker']); ?>",
		type: "GET",
		cache: false,
		dataType: "json",
		data: "args=" + JSON.stringify(args),
		success: function (resp) {
			if (resp['code'] != 0) {
				alert("handle error");
				return;
			}
		},
		error: function () {
			//alert('send error');
		}
	});
}

</script>

<!--
</body>
</html>
-->
